<%@ page language="java" contentType="text/html; charset=utf-8"
		 pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Shop</title>

		<!--  popper.min.js 用于弹窗、提示、下拉菜单 -->
		<script src="${pageContext.request.contextPath}/js/js/popper.min.js"></script>
		<link rel="stylesheet" href="${pageContext.request.contextPath}/js/css/bootstrap.min.css">
		<!-- 最新的 Bootstrap5 核心 JavaScript 文件 -->
		<script src="${pageContext.request.contextPath}/js/js/bootstrap.min.js"></script>
	</head>
	<body style="background: antiquewhite">
		<div class="container">
			<div class="row clearfix">
				<!--来一图片-->
					
					<div  class = "col-md-12 column col-md-offset-4 col-lg-offset-4col-xl-offset-4">
						<img  style="margin: auto;" src="./img/rebrand_shopbop_logo_2x_1-3.png"/>
					</div>	
					<!--导航栏-->
					<div class="col-md-12 column">
						<ul class="nav">
							<li class="nav-item">
								<a  href="javascript:location.reload();" class="nav-link" >ShopBop</a>
							</li>
							<li class="nav-item">
								<a target="_blank" href="./manage.jsp" class="btn btn-primary">返回</a>
							</li>

						</ul>



				</div>
				
		
				<!--
				
				实现装商品的盘子
				-->
				
			<div class="col-md-12 column">
	
			<div class="row">

				
				<div class="col-md-4">
					<form onsubmit="return check()" role="form" enctype="multipart/form-data" action="${pageContext.request.contextPath}/AddShopServlet" method="POST">
									<div class="form-group">
										 <label for="name">商品名称</label><input type="text"  name="name" class="form-control" id="name" />
									</div>
									<div class="form-group">
										 <label for="contenct">商品描述</label><input type="text"  name="contenct" class="form-control" id="contenct" />
									</div>
									<div class="form-group">
										 <label for="price">价格</label><input type="text" name="price" class="form-control" id="price" />
									</div>
									
									
									<div class="form-group">
										 <label for="exampleInputFile">选择图片</label>
										<input type="file" id="exampleInputFile" name="filename"/>
									</div>
								
									<button type="submit" class="btn btn-primary">添加商品</button>
						${message}
								</form>
					
			</div>	
		</div>	
					
			
				
					
		
				</div>
			</div>
				
			
			</div>
		</div>
		
		
		
		
	</body>
<script>
	function  check(){

		var name = document.getElementById('name').value
		var contenct = document.getElementById('contenct').value
		var discount = document.getElementById('discount').value
		var price = document.getElementById('price').value


		if(name==""){
			alert("请输入名字")
			return false
		}else if(contenct==""){
			alert("请输入内容")
		}else if(discount==""){
			alert("请输入折扣")
		}else if(price==""){
			alert("请输入价格")
		}else{
			return true
		}

	}

</script>
</html>
